package com.perfma.xtest.tool.word;

/**
 * 项目中的测试策略类型，也是合并报告生产数据时的聚合策略
 *
 * @author 武士
 * @version v1.1 2020年9月21日 上午11:53
 **/
public enum PlanGoalTypeEnum implements BaseCodeEnum {
    //GLOBAL("GLOBAL", 101, "全局目标",""),
    //CUSTOM("CUSTOM", 102, "自定义目标",""),
    BASELINE("BASELINE", 103, "基准场景", "不允许存在相同事务名"),
    SINGLE_USER_TREND("SINGLE_USER_TREND", 104, "单场景-并发数趋势", "不允许存在某个记录的【事务名+并发数】和另外一个记录完全相同"),
    MIX_USER_TREND("MIX_USER_TREND", 105, "混合场景-并发数趋势", "每个【压测记录】的事务名必须完全相同，不同【压测记录】的总并发数不允许相同"),
    STABLE_TIME_TREND("STABLE_TIME_TREND", 106, "稳定性-时间趋势", "不允许传入多个【压测记录】"),
    // SINGLE_USER_COMPARE("SINGLE_USER_COMPARE", 107, "单场景-同并发比对",""),
    //MIX_USER_COMPARE("MIX_COMPARE", 108, "混合场景-同并发比对",""),
    //STABLE_COMPARE("STABLE_COMPARE", 109, "稳定性-比对",""),
    ;

    private String label;
    private Integer code;
    private String name;
    private String checkMsg;

    @Override
    public Integer getCode() {
        return this.code;
    }


    PlanGoalTypeEnum(String name, Integer code, String label, String checkMsg) {
        this.name = name;
        this.code = code;
        this.label = label;
        this.checkMsg = checkMsg;
    }

    public String getLabel() {
        return label;
    }

    public String getName() {
        return name;
    }

    public String getCheckMsg() {
        return checkMsg;
    }

    public static PlanGoalTypeEnum nameOf(String name) {
        for (PlanGoalTypeEnum v : PlanGoalTypeEnum.values()) {
            if (v.name.equals(name)) {
                return v;
            }
        }
        return null;
    }
}
